<div style="padding-left: 15px;" id="new_project_link">
  <a href="#" id="add_project_link" onclick="Element.hide('new_project_link'); Element.show('new_project_div'); $('project_name').focus(); return false;" >New <%= @client ? @client.name : '' %> project</a>
</div>

<div id="new_project_div" style="display:none;">
  <%= form_tag :controller => 'projects', :action => 'create' %>

  <%= error_messages_for 'project' %>

  <!--[form:project]-->
  <input type="hidden" name="return_to" value="<%= url_for({}) %>" id="return_to" />
  <p><label for="project_name">Name</label><br/>
  <%= text_field 'project', 'name'  %></p>

  <p><label for="project_short">Short name</label><br/>
  <%= text_field 'project', 'short'  %></p>

  <% if @owner %>
  <p><label for="project_client_id">Client</label><br/>
  <%= collection_select('project', 'client_id', @owner.clients, "id", "short", { :include_blank => true }) %></p>
  <% else %>
  <%= hidden_field 'project', 'client_id' %></p>
  <% end %>

  <h2>Project assignees</h2>
  <% for user in @users %>
    <input type="checkbox"
           id="<%= user.id%>"
           name="assignee_ids[]"
           value="<%= user.id %>"
           <%if user.assigned_to?@project.id%>checked="checked"<%end%>
     > <%= user.name%> - <%= user.short %>
    </br>
  <%end%>

  <%= submit_tag "Create project" %> <a class="admin" href="#" onclick="Element.hide('new_project_div'); Element.show('new_project_link'); return false;">Cancel</a>
  <!--[eoform:project]-->
  </form>

</div>
